/**
Copyright 2011 Patrick Devaney

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Linear Equation Calculator
By: Patrick Devaney
Created: October 12th, 2011
Version: Beta 1


Known Bugs:
-Simplified fraction calculator is inaccurate in
some situations

TODO:
<dependancy="Fixing the simplified fraction calculator">
-Parallel calculator
-Perpendicular calculator
-Find another set of coordinates further down the line based on X1 and 2 and Y1 and 2
</dependency>
-Clean up code
*/
#include <iostream>
#include <string.h>
using namespace std;

// Function includes
// I try to keep them in the order they appear in the
// output below for organization purposes
#include "calc.m.xy12plugin.cpp"
#include "calc.b.xymplugin.cpp"
#include "calc.m.xybplugin.cpp"
#include "calc.point.xymplugin.cpp"
// The above one would be here, too

int main(int argc, const char* argv[]) {
int i;
i = 0;
cout << "Linear Equation Calculator" << endl << "Copyright (c) 2011 Patrick Devaney" << endl
<< "Licensed under the Apache License Version 2" << endl;
// This loop makes the code a bit messy,
// but it's worth it so the program doesn't
// crash if one enters random crap such as
// "zrgxvd" or "54336564358"
while(i < 1) {
cout << "Type:" << endl
<< "0 to calculate a slope (the M value) based on two points on a line" << endl
<< "1 to calculate the Y-intercept (the B value) based on two points and a slope" << endl
<< "2 to calculate the slope (the M value) based on the Y-intercept and X and Y" << endl <<
"plug-ins" << endl
<< "3 to find the next point up or down a line based on the slope (M) and X and Y"
<< endl << "plug-ins" << endl
<< "4 to find a point x positions down the line based on the slope (M) and X and Y"
<< endl << "plug-ins" << endl;

string selection;
cin >> selection;
if(selection == "0") {
mcalcxyplugin();
i++;
}
else if(selection == "1") {
calcbxymplugin();
i++;
}
else if(selection == "2") {
calcmxybplugin();
i++;
}
else if(selection == "3") {
calcpointxymplugin(1);
i++;
}
else if(selection == "4") {
int a;
cout << "How many points up/down the line do you want? (Positive number for points" << endl
<< "further up, negative for previous points" << endl;
cin >> a; 
calcpointxymplugin(a);
i++;
}
else {
i = 0;
}
// End of that loop below
}
return 0;
}